//
//  WBNavBar.h
//  WeatherBar
//
//  Created by yby on 2024/6/7.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

// 自定义NavBar的样式
typedef NS_ENUM(NSInteger, WBNavBarType) {
    /// 返回按钮+标题
    WBNavBarTypeNormal,
    /// 根Nav样式，只有标题
    WBNavBarTypeRoot,
    ///  只显示标题（左边显示）
    WBNavBarTypeOnlyLeftTitle,
    /// 左边头像，右边搜索框
    WBNavBarTypeIconSearch,
    /// 上下标题，右边搜索框
    WBNavBarTypeTileSubTileBack,
    /// 上下标题，左右按钮
    WBNavBarTypeLRTileSubTileBack,
    
    /// 只有搜索框
    WBNavBarTypeOnlySearch,
    /// 搜索+返回按钮
    WBNavBarTypeSearchBack,
    /// 搜索+返回按钮+右边按钮
    WBNavBarTypeSearchAll,

};

@interface WBNavBar : UIView

- (instancetype)initWithType:(WBNavBarType)type;
@property (nonatomic ,strong, readonly) UILabel *var_titleLabel;
/// 设置搜索框占位文字
@property (nonatomic ,copy) NSString *var_placeHolder;
/// 返回按钮
@property (nonatomic ,strong) UIView *var_backBtn;
/// 搜索框内左边选择按钮
@property (nonatomic ,strong) UIButton *var_leftSearchBtn;
/// 右边按钮
@property (nonatomic ,strong) UIButton *var_rightBtn;
/// 右边第二个按钮
@property (nonatomic ,strong) UIButton *var_rightSecondBtn;
/// 标题
@property (nonatomic ,copy) NSString *var_title;
/// 副标题
@property (nonatomic ,copy) NSString *var_subTitle;
/// 搜索框的文本框
@property (nonatomic ,strong) UITextField *var_textField;

@property(nonatomic, copy) void(^var_searchTextBlock)(NSString *string);
/// 点击搜索框的回调
@property (nonatomic ,strong) RACSubject *var_didClickRithtSubject;
/// 点击搜索框的回调
@property (nonatomic ,strong) RACSubject *var_didClickSearchSubject;
/// 点击了返回
@property (nonatomic ,strong) RACSubject *var_didClickBackSubject;

/// 点击了切换
@property (nonatomic ,strong) RACSubject *var_didClickSwichSubject;

/// 设置返回按钮
- (void)wb_setBackIcon:(UIImage *)icon;
/// 设置自定义导航透明度
- (void)wb_setupTransparent;
/// 设置导航颜色渐变
- (void)wb_setupAlpha:(CGFloat)alpha;
/// 设置标题显示
- (void)wb_setTitleVisible;
/// 设置标题隐藏
- (void)wb_setTitleHidden;
/// 设置icon图片
- (void)wb_setIocnImage:(NSString *)imageNmae;
/// 设置灰色搜索icon
- (void)wb_setSearchBlackIocn;
///设置右侧按钮
- (void)wb_setRightImg:(UIImage *)image;
///设置右侧第二个按钮
- (void)wb_setRightSecondImg:(UIImage *)image;
// 居中titile位置
- (void)wb_adjustCenterTitle;
// 显示搜索框左按钮更新名称
- (void)wb_showAndUpdateLeftSearchBtWithName:(NSString *)name;
@end

NS_ASSUME_NONNULL_END
